{include file="include:headerFile" /}
{include file="include:header" /}
<section>
    <div class="bannerswiper"></div>
</section>
<main>
    {include file="include:crumbs" /}
    <section>
        <div class="m-muban-cpxq w1600">
            <div class="m-muban-cpxq-kuang">
                <div class="m-muban-cpxq-kuang-left">
                    <div class="swiper swipercpxqbig">
                        <div class="swiper-wrapper">

                            <div class="swiper-slide">
                                <p class="m-muban-cpxq-img">
                                    <img src="{$dataItem.photo}" title="{$dataItem.name}"/>
                                </p>
                            </div>
                            {volist name='photoList' id='vo'}
                            {if $vo.link != $dataItem.photo}
                            <div class="swiper-slide">
                                <p class="m-muban-cpxq-img">
                                    <img src="{$vo.link}" title="{$vo.name}"/>
                                </p>
                            </div>
                            {/if}
                            {/volist}

                        </div>
                        <div class="swiper-button-next"></div>
                        <div class="swiper-button-prev"></div>
                    </div>

                    <div thumbsSlider="" class="swiper mySwiper cpxqswipersmall">
                        <div class="swiper-wrapper">
                            <div class="swiper-slide">
                                <p class="m-muban-cpxq-img">
                                    <img src="{$dataItem.photo}" title="{$vo.name}"/>
                                </p>
                            </div>
                            {volist name='photoList' id='vo'}
                            {if $vo.link != $dataItem.photo}
                            <div class="swiper-slide">
                                <p class="m-muban-cpxq-img">
                                    <img src="{$vo.link}" title="{$vo.name}"/>
                                </p>
                            </div>
                            {/if}
                            {/volist}
                        </div>
                    </div>
                </div>
                <div class="m-muban-cpxq-kuang-right">
                    <div class="m-muban-cpxq-kuang-right-div">
                        <h1 class="m-muban-cpxq-jiehao-title">
                            {$dataItem.name}
                        </h1>
                        {$dataItem.content | raw}
                        <a class="m-muban-cpxq-next xieleftright" href="{if !empty($nextProduct)}/{$nextProduct.rewrite_url}.html{else}javascript:;{/if}" title="{$nextProduct.name|default=''}">
                            Next Product
                        </a>
                        <a class="m-muban-cpxq-next xieleftright" href="https://wa.me/8618938710502?text=产品 : {$dataItem.name}" title="{$dataItem.name|default=''}">
                            Contact
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <section>
        <div class="cpxq-mid-miaodian">
            <div class="cpxq-mid-miaodian-top">
                <ul class="w1600">
                    {volist name='$dataItem.contentList' id='vo' key='k'}
                    <li class="{if $k == 1 }active{/if}"><a href="#section{$k}" title="{$vo.name}">{$vo.name}</a></li>
                    {/volist}
                </ul>
            </div>

            <!-- 产品内容板块 -->
            {volist name='$dataItem.contentList' id='vo' key='k'}

            <section id="section{$k}">

                {$vo.content | raw }
            </section>

            {/volist}

            {notempty name='downloadCategoryWithFiles'}
            <section>
                <div class="miaodian-kuang w1600">
                    <h2 class="miaodian-title">Download</h2>
                    <div class="download-table">
                        <ul>
                            {volist name="downloadCategoryWithFiles" id="category" key="k"}
                            <li class="{if condition='$k eq 1'}active{/if}">{$category.name|default=''}</li>
                            {/volist}
                        </ul>
                    </div>
                    <div class="download-table-nr">
                        {volist name="downloadCategoryWithFiles" id="category" key="k"}
                        <div class="down-table" style="{if condition='$k neq 1'}display:none;{/if}">
                            {volist name="category.files" id="file"}
                            <a href="{$file.url|default=''}" download>
                                <div class="down-table-left">
                                    <p class="down-table-title">{$file.name|default=''}</p>
                                    <p class="down-table-date">
                                        {$file.filetype|strtoupper} - {$file.file_size_text|default=''} - Updated {$file.update_time|date="l, F j, Y"}
                                    </p>
                                </div>
                                <p class="down-table-right xieleftright">
                                    <svg xmlns="http://www.w3.org/2000/svg"
                                         xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1"
                                         width="14" height="14" viewBox="0 0 14 14">
                                        <g>
                                            <g></g>
                                            <g></g>
                                            <g>
                                                <path
                                                        d="M10.78242,3.783268L10.78284,3.782843Q10.8391,3.726582,10.86955,3.653073Q10.9,3.5795649,10.9,3.5Q10.9,3.420435,10.86955,3.346926Q10.8391,3.273418,10.78284,3.217157Q10.78101,3.215327,10.779160000000001,3.21352Q10.72314,3.158931,10.650680000000001,3.129465Q10.57822,3.1,10.5,3.1L10.49557,3.100025Q10.417159999999999,3.100893,10.34488,3.131301Q10.2726,3.1617100000000002,10.21716,3.217157L3.217157,10.21716Q3.160896,10.27342,3.130448,10.34693Q3.1,10.42043,3.1,10.5Q3.1,10.50961,3.100462,10.519210000000001Q3.107885,10.67357,3.217157,10.78284Q3.273418,10.8391,3.346927,10.86955Q3.420435,10.9,3.5,10.9Q3.5795649,10.9,3.653073,10.86955Q3.726582,10.8391,3.782843,10.78284L3.783268,10.78242L10.78242,3.783268Z"
                                                        fill-rule="evenodd" fill="currentColor"
                                                        fill-opacity="1"/>
                                            </g>
                                            <g>
                                                <path
                                                        d="M10.100059070587157,3.900000238418579L10.100059070587157,9.19000023841858Q10.100059070587157,9.22940023841858,10.107749070587158,9.268040238418578Q10.115429070587158,9.30668023841858,10.13050907058716,9.34307023841858Q10.145579070587157,9.37947023841858,10.167469070587158,9.41223023841858Q10.189359070587159,9.44498023841858,10.21721907058716,9.472840238418579Q10.245069070587158,9.50070023841858,10.277829070587158,9.52259023841858Q10.31058907058716,9.54447023841858,10.346989070587158,9.559550238418579Q10.383379070587157,9.574630238418578,10.422019070587158,9.582310238418579Q10.460659070587159,9.590000238418579,10.50005907058716,9.590000238418579Q10.539459070587158,9.590000238418579,10.578099070587157,9.582310238418579Q10.616739070587158,9.574630238418578,10.653129070587159,9.559550238418579Q10.68952907058716,9.54447023841858,10.72228907058716,9.52259023841858Q10.75503907058716,9.50070023841858,10.782899070587158,9.472840238418579Q10.810759070587158,9.44498023841858,10.83264907058716,9.41223023841858Q10.854529070587159,9.37947023841858,10.869609070587158,9.34307023841858Q10.884689070587157,9.30668023841858,10.892369070587158,9.268040238418578Q10.900059070587158,9.22940023841858,10.900059070587158,9.19000023841858L10.900059070587158,3.500000238418579Q10.900059070587158,3.460603638418579,10.892369070587158,3.4219641384185793Q10.884689070587157,3.383324238418579,10.869609070587158,3.346927238418579Q10.854529070587159,3.310529238418579,10.83264907058716,3.2777722384185792Q10.810759070587158,3.245015238418579,10.782899070587158,3.217157238418579Q10.75503907058716,3.1893002384185793,10.72228907058716,3.167412238418579Q10.68952907058716,3.1455252384185792,10.653129070587159,3.130448238418579Q10.616739070587158,3.115372238418579,10.578099070587157,3.1076862384185793Q10.539459070587158,3.100000238418579,10.50005907058716,3.100000238418579L4.810059070587158,3.100000238418579Q4.770662470587158,3.100000238418579,4.732022970587158,3.1076862384185793Q4.693383070587158,3.115372238418579,4.656986070587158,3.130448238418579Q4.620588070587158,3.1455252384185792,4.587831070587158,3.167412238418579Q4.555074070587159,3.1893002384185793,4.5272160705871585,3.217157238418579Q4.4993590705871584,3.245015238418579,4.477471070587158,3.2777722384185792Q4.455584070587158,3.310529238418579,4.4405070705871585,3.346927238418579Q4.425431070587158,3.383324238418579,4.417745070587158,3.4219641384185793Q4.410059070587158,3.460603638418579,4.410059070587158,3.500000238418579Q4.410059070587158,3.539396838418579,4.417745070587158,3.578036338418579Q4.425431070587158,3.616676238418579,4.4405070705871585,3.653073238418579Q4.455584070587158,3.6894712384185793,4.477471070587158,3.722228238418579Q4.4993590705871584,3.754985238418579,4.5272160705871585,3.7828432384185793Q4.555074070587159,3.810700238418579,4.587831070587158,3.832588238418579Q4.620588070587158,3.854475238418579,4.656986070587158,3.869552238418579Q4.693383070587158,3.8846282384185793,4.732022970587158,3.892314238418579Q4.770662470587158,3.900000238418579,4.810059070587158,3.900000238418579L10.100059070587157,3.900000238418579Z"
                                                        fill-rule="evenodd" fill="currentColor"
                                                        fill-opacity="1"/>
                                            </g>
                                        </g>
                                    </svg>
                                </p>
                            </a>
                            {/volist}
                        </div>
                        {/volist}
                    </div>
                </div>
            </section>
            {/notempty}
        </div>
    </section>
</main>
{include file="include:footer" /}
{include file="include:footerFile" /}
<script>
    var cpxqswipersmall = new Swiper(".cpxqswipersmall", {
        spaceBetween: 12,
        slidesPerView: 4,
        freeMode: true,
        watchSlidesProgress: true,
    });
    var swipercpxqbig = new Swiper(".swipercpxqbig", {
        spaceBetween: 10,
        navigation: {
            nextEl: ".swiper-button-next",
            prevEl: ".swiper-button-prev",
        },
        thumbs: {
            swiper: cpxqswipersmall,
        },
    });
    $(".download-table-nr > .down-table").hide();
    $(".download-table-nr > .down-table").eq(0).show();
    $(".download-table > ul > li").click(function () {
        $(".download-table > ul > li").removeClass("active");
        $(this).addClass("active");
        var index = $(this).index();
        $(".download-table-nr > .down-table").hide();
        $(".download-table-nr > .down-table").eq(index).show();
    });
</script>
<script>
    document.addEventListener("DOMContentLoaded", () => {
        const navLinks = document.querySelectorAll(".cpxq-mid-miaodian-top a");
        const sections = document.querySelectorAll("[id^='section']");
        const offset = window.innerHeight * 0.5;

        let lastActiveId = null;

        // 点击时平滑滚动
        navLinks.forEach(link => {
            link.addEventListener("click", function(e) {
                const href = this.getAttribute("href");
                if (href && href.startsWith("#")) {
                    e.preventDefault();
                    const targetEl = document.querySelector(href);
                    if (targetEl) {
                        targetEl.scrollIntoView({
                            behavior: "smooth",
                            block: "start"
                        });
                    }
                }
            });
        });

        function checkScroll() {
            let activeSectionId = null;

            sections.forEach(section => {
                const rect = section.getBoundingClientRect();
                if (rect.top <= offset && rect.bottom >= 0) {
                    activeSectionId = section.id;
                }
            });

            if (activeSectionId === lastActiveId) return; // 没变则不动，避免频繁滚动

            lastActiveId = activeSectionId;
            // 高亮显示
            navLinks.forEach(link => {
                const href = link.getAttribute("href");
                if (!href || !href.startsWith("#")) return;

                const targetId = href.substring(1);
                const isActive = (targetId === activeSectionId);

                const parentLi = link.closest("li");
                if (parentLi) {
                    parentLi.classList.toggle("active", isActive);
                    if (isActive) {
                        // 只有高亮发生变化时才滚动到中间
                        parentLi.scrollIntoView({
                            behavior: "smooth",
                            inline: "center",
                            block: "nearest"
                        });
                    }
                } else {
                    link.classList.toggle("active", isActive);
                    if (isActive) {
                        link.scrollIntoView({
                            behavior: "smooth",
                            inline: "center",
                            block: "nearest"
                        });
                    }
                }
            });
        }

        // 防抖处理滚动事件
        let isScrolling;
        window.addEventListener("scroll", () => {
            clearTimeout(isScrolling);
            isScrolling = setTimeout(checkScroll, 100);
        });

        // 初始化时先高亮，但不滚动
        function initHighlight() {
            let activeSectionId = null;
            sections.forEach(section => {
                const rect = section.getBoundingClientRect();
                if (rect.top <= offset && rect.bottom >= 0) {
                    activeSectionId = section.id;
                }
            });
            lastActiveId = activeSectionId;

            navLinks.forEach(link => {
                const href = link.getAttribute("href");
                if (!href || !href.startsWith("#")) return;

                const targetId = href.substring(1);
                const isActive = (targetId === activeSectionId);

                const parentLi = link.closest("li");
                if (parentLi) {
                    parentLi.classList.toggle("active", isActive);
                } else {
                    link.classList.toggle("active", isActive);
                }
            });
        }
        initHighlight();
    });
</script>
</body>
</html>